import HTMLTestRunner_PY3
import yagmail
import logging
import pytest
from HTMLTestRunner_PY3 import HTMLTestRunner

def Log():
    logging.basicConfig(filename='zk3.log',
                        filemode='w+',
                        level=logging.INFO,
                        format='%(asctime)s %(filename)s %(lineno)s %(levelname)s %(message)s')

def Report():
    HTMLTestRunner_PY3.HTMLTestRunner(open('./Pozk0903/TestCase','wb+'),
                                      title='酒仙网报告',description='这是酒仙网的测试报告')


def Email(file):
    email=yagmail.SMTP(user='1522057104@qq.com',password='mhszldzvffpnjfcc',host='smtp.qq.com',port=465)
    email.send(to='1522057104@qq.com',subject='酒仙网测试',contents='这是酒仙网测试结果',attachments=file)



# if __name__ == '__main__':
#     Log()
#     pytest.main(['../Pozk0903/TestCase.py','-s','--html=jiuxianbaogao.html'])
#     Email(['zk3.log','jiuxianbaogao.html'])